import time
def bubble_sort(N):
    for i in range(0,len(N)-1):
        for j in range(len(N)-1):
            if(N[j]>N[j+1]):
                N[j],N[j+1] = N[j+1], N[j]
    return N
def read2list(fln):
    fl = open(fln, 'r')
    dt = fl.readlines()
    return dt
a = read2list("a_sorted.txt")
b = read2list("b_reverse.txt")
c = read2list("m3_shuffle.txt")
st = time.time()
bubble_sort(a)
fin = time.time()
print("a_sorted",round((fin-st)*1000),"milliseconds")
st = time.time()
bubble_sort(b)
fin = time.time()
print("b_reverse",round((fin-st)*1000),"milliseconds")
st = time.time()
bubble_sort(c)
fin = time.time()
print("c_shuffle",round((fin-st)*1000),"milliseconds")
